Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: feat($compile): display line numbers for errors in the parser (#6338) #6764

Closed
wants to merge 1 commit into from

Conversation

Kingwl
Copy link
Member

@Kingwl Kingwl commented Oct 10, 2017

#6338

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

export function parseHTML (html, options) {
const stack = []
const expectHTML = options.expectHTML
const isUnaryTag = options.isUnaryTag || no
const canBeLeftOpenTag = options.canBeLeftOpenTag || no
const lines = html.split(/\n/).map(x => x.length)
Copy link
Member

@gebilaoxiong gebilaoxiong Oct 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can I use /\r\n?|\n|\u2028|\u2029/ ....? 😃

@Kingwl Kingwl force-pushed the new_dev branch 2 times, most recently from e27e04d to f1e2684 Compare October 10, 2017 08:05
@Kingwl Kingwl changed the title feat($compile): display line numbers for errors in the parser feat($compile): display line numbers for errors in the parser (#6338) Oct 10, 2017
@yyx990803
Copy link
Member

This is great! A few things to improve:

  • Make this dev mode only to save bytes
  • Extend this feature to all warnings during template compilation, including parser and codegen

@Kingwl Kingwl changed the title feat($compile): display line numbers for errors in the parser (#6338) WIP: feat($compile): display line numbers for errors in the parser (#6338) Nov 16, 2017
@yyx990803
Copy link
Member

Thanks for the great work on starting this - closing in favor of #7127

@yyx990803 yyx990803 closed this Dec 12, 2017
@Kingwl Kingwl deleted the new_dev branch December 29, 2017 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants